package com.seecen.server.config;

import com.seecen.server.intercept.TokenIntercept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class InterceptConfig implements WebMvcConfigurer {
    @Autowired
    private RedisTemplate<String,String> redisTemplate;

    public void addInterceptors(InterceptorRegistry registry) {
            registry.addInterceptor(new TokenIntercept(redisTemplate))
                    .addPathPatterns("/**")
                    .excludePathPatterns("/api/register","/api/login");
    }
}
